function checkEmojiSupport(emoji: string): boolean {
  const canvas: HTMLCanvasElement = document.createElement('canvas')
  const ctx: CanvasRenderingContext2D | null = canvas.getContext('2d')
  if (!ctx) return false
  ctx.fillStyle = '#000000'
  ctx.textBaseline = 'top'
  ctx.font = '32px Arial'
  ctx.fillText(emoji, 0, 0)
  return ctx.getImageData(16, 16, 1, 1).data[3] !== 0
}

export default checkEmojiSupport
